<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>智能文档解析与内容生成</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.1/font/bootstrap-icons.css">
    <style>
        :root {
            --primary-color: #4e73df;
            --secondary-color: #1cc88a;
            --accent-color: #f6c23e;
            --dark-color: #5a5c69;
            --light-color: #f8f9fc;
        }
        
        body {
            font-family: 'Nunito', 'Segoe UI', Roboto, sans-serif;
            background-color: var(--light-color);
            color: var(--dark-color);
        }
        
        .app-container {
            max-width: 1200px;
            margin: 0 auto;
            padding: 2rem;
        }
        
        .app-header {
            text-align: center;
            margin-bottom: 2rem;
            padding: 1rem;
            background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
            border-radius: 10px;
            color: white;
            box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        }
        
        .upload-container {
            background-color: white;
            border-radius: 10px;
            padding: 2rem;
            box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
            margin-bottom: 2rem;
            transition: all 0.3s ease;
        }
        
        .upload-container:hover {
            transform: translateY(-5px);
        }
        
        .drop-zone {
            border: 2px dashed var(--primary-color);
            border-radius: 10px;
            padding: 3rem;
            text-align: center;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .drop-zone:hover, .drop-zone.dragover {
            background-color: rgba(78, 115, 223, 0.1);
            border-color: var(--secondary-color);
        }
        
        .file-preview {
            margin-top: 1.5rem;
            display: none;
        }
        
        .preview-card {
            border-radius: 10px;
            overflow: hidden;
            box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
        }
        
        .options-container {
            background-color: white;
            border-radius: 10px;
            padding: 2rem;
            box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
            margin-bottom: 2rem;
            display: none;
        }
        
        .option-card {
            border-radius: 10px;
            border: 1px solid rgba(0,0,0,0.125);
            padding: 1.5rem;
            margin-bottom: 1rem;
            cursor: pointer;
            transition: all 0.3s ease;
        }
        
        .option-card:hover {
            transform: translateY(-5px);
            box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
            border-color: var(--primary-color);
        }
        
        .option-card.selected {
            border: 2px solid var(--primary-color);
            background-color: rgba(78, 115, 223, 0.1);
        }
        
        .result-container {
            background-color: white;
            border-radius: 10px;
            padding: 2rem;
            box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
            margin-bottom: 2rem;
            display: none;
        }
        
        .loading-spinner {
            display: none;
            text-align: center;
            padding: 2rem;
        }
        
        .btn-primary {
            background-color: var(--primary-color);
            border-color: var(--primary-color);
        }
        
        .btn-primary:hover {
            background-color: #2e59d9;
            border-color: #2653d4;
        }
        
        .btn-success {
            background-color: var(--secondary-color);
            border-color: var(--secondary-color);
        }
        
        .btn-success:hover {
            background-color: #17a673;
            border-color: #169b6b;
        }
        
        .feature-icon {
            font-size: 2rem;
            margin-bottom: 1rem;
            color: var(--primary-color);
        }
        
        .progress {
            height: 10px;
            margin-bottom: 1rem;
        }
        
        @media (max-width: 768px) {
            .app-container {
                padding: 1rem;
            }
        }
    </style>
</head>
<body>
    <div class="app-container">
        <div class="app-header">
            <h1><i class="bi bi-file-earmark-text"></i> 智能文档解析与内容生成</h1>
            <p class="lead">上传您的文件，我们将智能解析并生成您需要的内容</p>
        </div>
        
        <div class="upload-container">
            <h2 class="mb-4"><i class="bi bi-cloud-arrow-up"></i> 上传文件</h2>
            <div class="drop-zone" id="dropZone">
                <i class="bi bi-cloud-upload feature-icon"></i>
                <h3>拖放文件到这里</h3>
                <p>或者</p>
                <button class="btn btn-primary" id="fileSelectBtn">选择文件</button>
                <input type="file" id="fileInput" style="display: none;" accept=".jpg,.jpeg,.png,.gif,.xlsx,.xls,.doc,.docx,.pdf,.ppt,.pptx">
                <p class="mt-3 text-muted">支持的格式: 图片(JPG, PNG, GIF), Excel, Word, PDF, PowerPoint</p>
            </div>
            
            <div class="file-preview" id="filePreview">
                <div class="card preview-card">
                    <div class="card-header d-flex justify-content-between align-items-center">
                        <h5 class="mb-0" id="fileName">文件名称</h5>
                        <button class="btn btn-sm btn-outline-danger" id="removeFileBtn">
                            <i class="bi bi-x-lg"></i> 移除
                        </button>
                    </div>
                    <div class="card-body">
                        <div class="row">
                            <div class="col-md-4">
                                <div id="fileThumb" class="text-center">
                                    <i class="bi bi-file-earmark feature-icon"></i>
                                </div>
                            </div>
                            <div class="col-md-8">
                                <p><strong>文件类型:</strong> <span id="fileType">-</span></p>
                                <p><strong>文件大小:</strong> <span id="fileSize">-</span></p>
                                <div class="progress">
                                    <div class="progress-bar bg-success" role="progressbar" style="width: 100%" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100"></div>
                                </div>
                                <p class="text-success"><i class="bi bi-check-circle"></i> 文件已准备好进行解析</p>
                                <button class="btn btn-primary" id="parseFileBtn">
                                    <i class="bi bi-magic"></i> 开始解析
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        
        <div class="options-container" id="optionsContainer">
            <h2 class="mb-4"><i class="bi bi-gear"></i> 选择生成内容类型</h2>
            <p>根据您上传的文件内容，您可以选择生成以下类型的内容：</p>
            
            <div class="row">
                <div class="col-md-4 mb-4">
                    <div class="option-card" data-option="report">
                        <i class="bi bi-file-text feature-icon"></i>
                        <h4>工作报告</h4>
                        <p>根据文件内容生成专业的工作报告，包括数据分析、图表和结论。</p>
                    </div>
                </div>
                <div class="col-md-4 mb-4">
                    <div class="option-card" data-option="presentation">
                        <i class="bi bi-easel feature-icon"></i>
                        <h4>演示幻灯片</h4>
                        <p>将文件内容转换为精美的演示幻灯片，适合会议和展示。</p>
                    </div>
                </div>
                <div class="col-md-4 mb-4">
                    <div class="option-card" data-option="education">
                        <i class="bi bi-mortarboard feature-icon"></i>
                        <h4>教育课件</h4>
                        <p>生成教育培训课件，包括知识点、练习和测验。</p>
                    </div>
                </div>
                <div class="col-md-4 mb-4">
                    <div class="option-card" data-option="summary">
                        <i class="bi bi-journal-text feature-icon"></i>
                        <h4>内容摘要</h4>
                        <p>提取文件的关键信息，生成简洁明了的内容摘要。</p>
                    </div>
                </div>
                <div class="col-md-4 mb-4">
                    <div class="option-card" data-option="infographic">
                        <i class="bi bi-bar-chart feature-icon"></i>
                        <h4>信息图表</h4>
                        <p>将数据和信息转换为直观的信息图表，便于理解和分享。</p>
                    </div>
                </div>
                <div class="col-md-4 mb-4">
                    <div class="option-card" data-option="video">
                        <i class="bi bi-camera-video feature-icon"></i>
                        <h4>演示视频</h4>
                        <p>基于文件内容创建简短的演示视频脚本和分镜。</p>
                    </div>
                </div>
            </div>
            
            <div class="text-center mt-4">
                <button class="btn btn-success btn-lg" id="generateBtn" disabled>
                    <i class="bi bi-lightning"></i> 生成内容
                </button>
            </div>
        </div>
        
        <div class="loading-spinner" id="loadingSpinner">
            <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
                <span class="visually-hidden">加载中...</span>
            </div>
            <h3 class="mt-3">正在处理您的文件...</h3>
            <p>这可能需要几分钟时间，请耐心等待</p>
        </div>
        
        <div class="result-container" id="resultContainer">
            <h2 class="mb-4"><i class="bi bi-check-circle"></i> 生成结果</h2>
            <div id="resultContent">
                <!-- 生成的内容将在这里显示 -->
            </div>
            <div class="text-center mt-4">
                <button class="btn btn-primary me-2" id="downloadBtn">
                    <i class="bi bi-download"></i> 下载结果
                </button>
                <button class="btn btn-outline-primary" id="newFileBtn">
                    <i class="bi bi-plus-circle"></i> 处理新文件
                </button>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/tesseract.js@4.1.1/dist/tesseract.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.3.0/dist/chart.umd.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/build/pdf.min.js"></script>
    <script src="file-parser-app.js"></script>                     <p>将数据和信息转换为直观的信息图表，便于理解和分享。</p>
                    </div>
                </div>
                <div class="col-md-4 mb-4">
                    <div class="option-card" data-option="video">
                        <i class="bi bi-camera-video feature-icon"></i>
                        <h4>演示视频</h4>
                        <p>基于文件内容创建简短的演示视频脚本和分镜。</p>
                    </div>
                </div>
            </div>
            
            <div class="text-center mt-4">
                <button class="btn btn-success btn-lg" id="generateBtn" disabled>
                    <i class="bi bi-lightning"></i> 生成内容
                </button>
            </div>
        </div>
        
        <div class="loading-spinner" id="loadingSpinner">
            <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
                <span class="visually-hidden">加载中...</span>
            </div>
            <h3 class="mt-3">正在处理您的文件...</h3>
            <p>这可能需要几分钟时间，请耐心等待</p>
        </div>
        
        <div class="result-container" id="resultContainer">
            <h2 class="mb-4"><i class="bi bi-check-circle"></i> 生成结果</h2>
            <div id="resultContent">
                <!-- 生成的内容将在这里显示 -->
            </div>
            <div class="text-center mt-4">
                <button class="btn btn-primary me-2" id="downloadBtn">
                    <i class="bi bi-download"></i> 下载结果
                </button>
                <button class="btn btn-outline-primary" id="newFileBtn">
                    <i class="bi bi-plus-circle"></i> 处理新文件
                </button>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/tesseract.js@4.1.1/dist/tesseract.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.3.0/dist/chart.umd.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/build/pdf.min.js"></script>
    <script src="file-parser-app.js"></script>                     <p>将数据和信息转换为直观的信息图表，便于理解和分享。</p>
                    </div>
                </div>
                <div class="col-md-4 mb-4">
                    <div class="option-card" data-option="video">
                        <i class="bi bi-camera-video feature-icon"></i>
                        <h4>演示视频</h4>
                        <p>基于文件内容创建简短的演示视频脚本和分镜。</p>
                    </div>
                </div>
            </div>
            
            <div class="text-center mt-4">
                <button class="btn btn-success btn-lg" id="generateBtn" disabled>
                    <i class="bi bi-lightning"></i> 生成内容
                </button>
            </div>
        </div>
        
        <div class="loading-spinner" id="loadingSpinner">
            <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
                <span class="visually-hidden">加载中...</span>
            </div>
            <h3 class="mt-3">正在处理您的文件...</h3>
            <p>这可能需要几分钟时间，请耐心等待</p>
        </div>
        
        <div class="result-container" id="resultContainer">
            <h2 class="mb-4"><i class="bi bi-check-circle"></i> 生成结果</h2>
            <div id="resultContent">
                <!-- 生成的内容将在这里显示 -->
            </div>
            <div class="text-center mt-4">
                <button class="btn btn-primary me-2" id="downloadBtn">
                    <i class="bi bi-download"></i> 下载结果
                </button>
                <button class="btn btn-outline-primary" id="newFileBtn">
                    <i class="bi bi-plus-circle"></i> 处理新文件
                </button>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/tesseract.js@4.1.1/dist/tesseract.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.3.0/dist/chart.umd.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/build/pdf.min.js"></script>
    <script src="file-parser-app.js"></script>                     <p>将数据和信息转换为直观的信息图表，便于理解和分享。</p>
                    </div>
                </div>
                <div class="col-md-4 mb-4">
                    <div class="option-card" data-option="video">
                        <i class="bi bi-camera-video feature-icon"></i>
                        <h4>演示视频</h4>
                        <p>基于文件内容创建简短的演示视频脚本和分镜。</p>
                    </div>
                </div>
            </div>
            
            <div class="text-center mt-4">
                <button class="btn btn-success btn-lg" id="generateBtn" disabled>
                    <i class="bi bi-lightning"></i> 生成内容
                </button>
            </div>
        </div>
        
        <div class="loading-spinner" id="loadingSpinner">
            <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
                <span class="visually-hidden">加载中...</span>
            </div>
            <h3 class="mt-3">正在处理您的文件...</h3>
            <p>这可能需要几分钟时间，请耐心等待</p>
        </div>
        
        <div class="result-container" id="resultContainer">
            <h2 class="mb-4"><i class="bi bi-check-circle"></i> 生成结果</h2>
            <div id="resultContent">
                <!-- 生成的内容将在这里显示 -->
            </div>
            <div class="text-center mt-4">
                <button class="btn btn-primary me-2" id="downloadBtn">
                    <i class="bi bi-download"></i> 下载结果
                </button>
                <button class="btn btn-outline-primary" id="newFileBtn">
                    <i class="bi bi-plus-circle"></i> 处理新文件
                </button>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/tesseract.js@4.1.1/dist/tesseract.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.3.0/dist/chart.umd.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/pdfjs-dist@3.11.174/build/pdf.min.js"></script>
    <script src="file-parser-app.js"></script>                     <p>将数据和信息转换为直观的信息图表，便于理解和分享。</p>
                    </div>
                </div>
                <div class="col-md-4 mb-4">
                    <div class="option-card" data-option="video">
                        <i class="bi bi-camera-video feature-icon"></i>
                        <h4>演示视频</h4>
                        <p>基于文件内容创建简短的演示视频脚本和分镜。</p>
                    </div>
                </div>
            </div>
            
            <div class="text-center mt-4">
                <button class="btn btn-success btn-lg" id="generateBtn" disabled>
                    <i class="bi bi-lightning"></i> 生成内容
                </button>
            </div>
        </div>
        
        <div class="loading-spinner" id="loadingSpinner">
            <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
                <span class="visually-hidden">加载中...</span>
            </div>
            <h3 class="mt-3">正在处理您的文件...</h3>
            <p>这可能需要几分钟时间，请耐心等待</p>
        </div>
        
        <div class="result-container" id="resultContainer">
            <h2 class="mb-4"><i class="bi bi-check-circle"></i> 生成结果</h2>
            <div id="resultContent">
                <!-- 生成的内容将在这里显示 -->
            </div>
            <div class="text-center mt-4">
                <button class="btn btn-primary me-2" id="downloadBtn">
                    <i class="bi bi-download"></i> 下载结果
                </button>
                <button class="btn btn-outline-primary" id="newFileBtn">
                    <i class="bi bi-plus-circle"></i> 处理新文件
                </button>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/tesseract.js@4.1.1/dist/tesseract.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/chart.js@4.3.0/dist/chart.umd.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/xlsx@0.18.5/dist/xlsx.full.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/pdf.js-extract@0.2.1/build/pdf.worker.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/pdf.js-extract@0.2.1/build/pdf-extract.min.js"></script>                     <p>将数据和信息转换为直观的信息图表，便于理解和分享。</p>
                    </div>
                </div>
                <div class="col-md-4 mb-4">
                    <div class="option-card" data-option="video">
                        <i class="bi bi-camera-video feature-icon"></i>
                        <h4>演示视频</h4>
                        <p>基于文件内容创建简短的演示视频脚本和分镜。</p>
                    </div>
                </div>
            </div>
            
            <div class="text-center mt-4">
                <button class="btn btn-success btn-lg" id="generateBtn" disabled>
                    <i class="bi bi-lightning"></i> 生成内容
                </button>
            </div>
        </div>
        
        <div class="loading-spinner" id="loadingSpinner">
            <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
                <span class="visually-hidden">加载中...</span>
            </div>
            <h3 class="mt-3">正在处理您的文件...</h3>
            <p>这可能需要几分钟时间，请耐心等待</p>
        </div>
        
        <div class="result-container" id="resultContainer">
            <h2 class="mb-4"><i class="bi bi-check-circle"></i> 生成结果</h2>
            <div id="resultContent">
                <!-- 生成的内容将在这里显示 -->
            </div>
            <div class="text-center mt-4">
                <button class="btn btn-primary me-2" id="downloadBtn">
                    <i class="bi bi-download"></i> 下载结果
                </button>
                <button class="btn btn-outline-primary" id="newFileBtn">
                    <i class="bi bi-plus-circle"></i> 处理新文件
                </button>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script src="file-parser-app.js"></script>
</body>
</html>